package com.aisile.article.controller.v1;

import com.aisile.apis.article.ArticleHomeControllerApi;
import com.aisile.article.service.ApArticleService;
import com.aisile.model.article.dtos.ArticleHomeDto;
import com.aisile.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther:yry
 * @Date:2024/1/12 0012
 * @VERSON:1.0
 */
@RestController
@RequestMapping("/api/v1/article")
public class ArticleHomeController implements ArticleHomeControllerApi {

    @Autowired
    private ApArticleService apArticleService;


    @PostMapping("/load")
    @Override
    public ResponseResult load(ArticleHomeDto dto) {
        return apArticleService.load(dto,(short)1);
    }

    @PostMapping("/loadnew")
    @Override
    public ResponseResult loadNew(ArticleHomeDto dto) {
        return apArticleService.load(dto,(short)2);
    }

    @PostMapping("/loadmore")
    @Override
    public ResponseResult loadMore(ArticleHomeDto dto) {
        return apArticleService.load(dto,(short)1);
    }
}
